import { _decorator, Component, Node, NodeEventType } from 'cc';
import { RankPage } from './RankPage';
import { WXUtils } from './WXUtils';
import { GameStorage, RankMesgType, StorageKey } from './Global';
const { ccclass, property } = _decorator;


@ccclass('RankAction')
export class RankAction extends Component {

    @property({ type: RankPage })
    RankPageNode: RankPage = null;
    start() {
        this.node.on(Node.EventType.TOUCH_END, this.onClick, this);

    }

    update(deltaTime: number) {

    }
    async onClick(TOUCH_END: NodeEventType, onClick: any, arg2: this) {
        // 向数据域发送用户信息
        WXUtils.postMessage({ type: RankMesgType.RANK_ALL })
        // 显示排行榜页面
        this.RankPageNode.showPage()
    }
}


